package org.duiduo.api.request;

import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * base请求
 *
 * @author liangze
 * @date 2021/9/18 15:40
 */
@Getter
@Setter
public class BaseRequest implements Serializable {
    /**
     * 页条数大小
     */
    private int pageSize = 10;

    /**
     * 当前页
     */
    private int pageNum = 1;

    private int start;

    public Integer getStart() {
        return (pageNum - 1) * getPageSize();
    }

    @Override
    public String toString() {
        return JSONObject.toJSONString(this);
    }
}
